<?php 
error_reporting(0);
$isadmin=1; 
include '../comm/config.php';
include '../comm/checkpostandget.php';
include 'check.php';
include_once 'include/page.class.php';

$keyword=$_GET['keyword']; 
$page = !($_GET['page'])?'1':intval($_GET['page']);
$pagesize=10;
$page2=($page-1)*$pagesize;

$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
	die(ERR_DB);
}
else
{
	mysql_query("set names utf8");
	$sql="select * from ".$BIAOTOU."tbjy where (tbcode like '%".$keyword."%' or ddusername like '%".$keyword."%') ";
	mysql_select_db($dbname);
	$rs = mysql_query($sql);
	$total = mysql_num_rows($rs);	
	
	$sql="select * from ".$BIAOTOU."tbjy where (tbcode like '%".$keyword."%' or ddusername like '%".$keyword."%' ) order by id desc limit $page2,$num1";
	$rs = mysql_query($sql);
}
mysql_close($link);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理中心</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {
	color: #FFFFFF;
	font-weight: bold;
	font-size:14px;
	text-decoration:none;
}
.STYLE2 {
	color: #555555;
	font-weight: bold;
	font-size:14px;
	text-decoration:none;
}
-->
</style>
</head>

<body topmargin="5" leftmargin="0">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="282" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td>
          <table cellspacing="0" width="100%" height="207" style="border:1px  solid #DCEAF7;">
            <tr>
              <td width="551" height="30" align="left" bgcolor="E9F2FB" class="bigtext"><strong>&nbsp;<img src="images/arrow.gif" width="16" height="22" align="absmiddle" /> 补交订单管理 [ <a href="pipei.php" class="link3">开始匹配订单</a> ] </strong></td>
              <form id="form1" name="form1" method="get" action="">
              <td width="500" align="left" bgcolor="E9F2FB" class="bigtext">交易号或提交人
                  <input type="text" class="btn3" name="keyword" />
                  <input type="submit" name="Submit" value="查找" />
                </td></form>
              <td width="167" height="30" align="right" bgcolor="E9F2FB" class="bigtext">共有 <b><?php echo $total;?></b> 条记录&nbsp;&nbsp;</td>
            </tr>
            <tr>
              <td colspan="3" valign="top"><table width="100%" height="300" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td valign="top"><table width="100%" border=1 cellpadding=0 cellspacing=0
style="border-collapse: collapse" bordercolor="#dddddd">
                    <tr>
                      <td width="25%" height="30" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;淘宝交易号</strong></td>
                      <td width="28%" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;提交人</strong><strong>&nbsp;</strong></td>
                      <td width="21%" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;提交时间</strong></td>
                      <td width="14%" align="center" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;匹配状态</strong></td>
                      <td width="12%" align="center" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;执行操作</strong></td>
                    </tr>
                    <?php
					while ($row = mysql_fetch_array($rs))
					{
						if($row["jystate"]==0)
							$zt="<font color=#ff3300>尚未匹配</font>";
						else
							$zt="<font color=#009900>匹配成功</font>";
						echo "<tr>";
                      	echo "<td height=30 class=bigtext>&nbsp;".$row["tbcode"]."</td>";
						echo "<td class=bigtext>&nbsp;".$row["ddusername"]."</td>";
						echo "<td class=bigtext>&nbsp;".$row["addtime"]."</td>";
						echo "<td class=bigtext align=center>&nbsp;".$zt."</td>";
						echo "<td class=bigtext align=center>&nbsp;<a href=deljy.php?id=".$row["Id"]." class=link4>删除</a></td>";
						echo "</tr>";
					}
					?></table>
                  <div class="yahoo2" style=" margin-top:30px;"><?php 
				pageft($total,$pagesize,1,1,0,10,"jylist.php?keyword=".urlencode($keyword));
				echo $pagenav;?></div>
                  </td>
                </tr>
              </table></td>
            </tr>
          </table></td>
        </tr>
      
    </table></td>
  </tr>
</table>
</body>
</html>
<?php mysql_close($link);?>
